package com.zeroup.auto.assists.step.unify;

import android.graphics.Path;
import android.util.Log;

import androidx.annotation.NonNull;

import com.alibaba.fastjson.JSON;
import com.blankj.utilcode.util.ScreenUtils;
import com.ven.assists.Assists;
import com.ven.assists.AssistsWindowManager;
import com.ven.assists.stepper.StepCollector;
import com.zeroup.auto.assists.DouYinBaseStep;
import com.zeroup.auto.assists.kt.MyContinuation;
import com.zeroup.auto.assists.next.StepBeanData;
import com.zeroup.auto.assists.step.unify.bean.LikeValue;
import com.zeroup.auto.utils.AssistsUtils;
import com.zeroup.auto.utils.RandomUtile;

public class ClickScreenCentStep extends DouYinBaseStep {
    @Override
    public void onImpl(@NonNull StepCollector stepCollector) {
        stepCollector.next(1,false,(i,c)->{
            Object serviceData = AssistsUtils.getServiceData(i.getData());
            if(serviceData==null){
                return AssistsUtils.nextStep( i.getData());
            }
            if(serviceData instanceof StepBeanData){
                int x = ScreenUtils.getAppScreenWidth() / 2;
                int y = ScreenUtils.getAppScreenHeight() / 2;
                MyContinuation myContinuation = new MyContinuation();
                Path mPath=new Path();
                mPath.moveTo(x, y);
                mPath.lineTo(x, y);
                AssistsWindowManager.INSTANCE.switchNotTouchableAll();
                Assists.gesture(mPath,0,1,myContinuation);
                AssistsWindowManager.INSTANCE.switchTouchableAll();
            }
            return AssistsUtils.nextStep(i.getData());
        });
    }
}
